package com.lhys.mapper;

import com.lhys.pojo.AssetDiscardMode;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资产_报废方式表 Mapper 接口
 * </p>
 *
 * @author 小七
 * @since 2021-05-06
 */
public interface AssetDiscardModeMapper {
    @Insert("INSERT INTO asset_discard_mode(asset_user_id, title, code, status, remark, create_time) VALUES (#{assetUserId}, #{title}, #{code}, #{status}, #{remark}, #{createTime})")
    Integer addAssetDiscardMode(AssetDiscardMode assetDiscardMode);

    @Delete("delete from asset_discard_mode where id = #{id}")
    Integer delAssetDiscardMode(Integer id);

    Integer updateAssetDiscardMode(AssetDiscardMode assetDiscardMode);

    @Select("select * from asset_discard_mode where id = #{id}")
    AssetDiscardMode getAssetDiscardModeById(Integer id);

    @Select("select * from asset_discard_mode where asset_user_id = #{id}")
    AssetDiscardMode getAssetDiscardModeByUserId(Integer id);

    @Select("select * from asset_discard_mode where code = #{code}")
    AssetDiscardMode getAssetDiscardModeByCode(String code);

    List<AssetDiscardMode> getAssetDiscardModeByCodeAndTitleOrRemarkList(AssetDiscardMode assetDiscardMode);
}
